<template>
    <el-popover placement="right" :width="400" trigger="click">
            <template #reference>
                <el-link type="primary">添加</el-link>
            </template>
            <el-form label-width="100px">
                <el-form-item label="权限名称">
                    <el-input placeholder="输入名称"></el-input>
                </el-form-item>
                <el-form-item label="访问路径">
                    <el-input placeholder="输入访问的路径"></el-input>
                </el-form-item>
                <el-form-item label="操作">
                    <el-input placeholder="输入名称"></el-input>
                </el-form-item>
            </el-form>
            <el-button @click="handleAdd">立即添加</el-button>
            </el-popover>
</template>

<script>
import { addRole } from '@/api/role';

export default {
  props: ['node', 'nodedata'],
  data() {
    return {
      name: '',
    };
  },
  mounted() {
    console.log('node', this.node);
    console.log('nodedata', this.nodedata);
  },
  methods: {
    async handleAdd() {
      console.log('id', this.nodedata.id);
      const res = await addRole({
        pid: this.nodedata.id,
      });
    },
  },
};
</script>
